home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / w00w00 / w00os / shared / src / halt.asm < prev    next >
Encoding:
Assembly Source File  |  1998-12-31  |  1.2 KB  |  44 lines

  1. ; this file has functions to halt/reboot the computer
  2. ; ---------------------------------------------------
  3.  
  4. ;--------------------------------------------------------
  5. ; used to reboot the computer (bios style)
  6. ;--------------------------------------------------------
  7.  
  8. reboot:
  9.     mov si,rebootmsg    ; load ds:si with the message for printmsg
  10.     call printmsg        ; output the "now rebooting" message
  11.  
  12.     call getkey        ; wait for user input
  13.  
  14.     ; load one of the below values into BIOS addr 40:72 in real mode
  15.     ; note: it will re-enter at 0040:0067
  16.  
  17.     ; 0x0000 = cold boot, 0x1234 = warm boot
  18.     mov ax,40        ; use extra segment as bios segment
  19.     mov es,ax        ; copy seg addr into es
  20.  
  21.     mov bx,72        ; offset into bios
  22.  
  23.     mov word [es:bx],0x1234    ; set up to do a cold boot
  24.  
  25.     jmp 0ffffh:0fff0h    ; jump to cause the actual reboot
  26.  
  27.     ; should never get here
  28.     jmp halt        ; if this fails.. try plain reboot
  29.  
  30.  
  31. ;--------------------------------------------------------
  32. ; used to halt the computer
  33. ;--------------------------------------------------------
  34.  
  35. halt:
  36.     cli            ; disable interrupts
  37.  
  38.     mov si,haltmsg        ; put msg in ds:si for printmsg
  39.     call printmsg        ; print the "system halted" message
  40.  
  41. .halt1:    hlt            ; do halt (idle)
  42.     jmp short .halt1    ; loop here endlessly
  43.  
  44.